<template>
  <div>
    <div v-for="it, i in list" :key="i">
      <slot :data="it"></slot>
    </div>
  </div>
</template>
<script>
export default {
  name: 'RightsItem',
  props: {
    leng: {
      type: Number,
      default: 5
    },
    catList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  computed: {
    list () {
      const list = []
      for (const cItem of this.catList) {
        for (const it of cItem.right_list) {
          list.push(it)
          if (list.length === this.leng) {
            return list
          }
        }
      }
      return list
    }
  }
}
</script>
